home *** CD-ROM | disk | FTP | other *** search
/ Aminet 25 / Aminet 25 (1998)(GTI - Schatztruhe)[!][Jun 1998].iso / Aminet / text / tex / amiweb2c.lha / AmiWeb2c-2.1 / texmf / pastex / rexx / NextError.ced < prev    next >
Encoding:
Text File  |  1997-02-09  |  2.7 KB  |  117 lines

  1. /*
  2. ** AREXX $VER: NextError.ced V1.23 (12.11.1995)
  3. **
  4. ** Skip through all \TeX-errors given in the `.log' file.
  5. **
  6. ** Idea: Take the filename and line-number of the current view,
  7. **    replace `.tex' (or `.ltx' in case of a LaTeX file) with `.log'. Go to
  8. **    the logfile and search the first `^Jl.' with a number greater than
  9. **    the current line number.
  10. **
  11. ** Georg Hessmann (hes) 26-jul-91
  12. **
  13. ** Changes: Take the filename and the associate `.log' file. Jump through the
  14. **    series of errors given in the `.log' file rather than to the next error
  15. **    relative to the current position in the `.tex' file. This is much faster.
  16. **
  17. **    Make use of the `NameStruc' script for extracting the filename.
  18. **
  19. ** Andreas Scherer (as) 10-sep-92
  20. **
  21. **    Allow for LaTeX files with `.ltx' extension.
  22. **
  23. ** Andreas Scherer (as) 19-feb-93
  24. **
  25. **    Search for `l.' in the first column only.
  26. **
  27. ** Andreas Scherer (as) 12-nov-95
  28. */
  29.  
  30. Options Results
  31.  
  32. /*
  33. ** Full FileName from CED-file
  34. */
  35. Status 19
  36. FULLNAME = RESULT
  37.  
  38. Parse Value NameStruc(FULLNAME) With IVOL IDIRS IBASE .
  39.  
  40. /*
  41. ** Do we really have a TeX input file?
  42. */
  43. If "" = SubStr(FULLNAME,1+IVOL+IDIRS+IBASE) | Upper(Right(FULLNAME,3)) ~= "TEX" Then Do
  44.  
  45. /*
  46. ** Or is it a LateX input file?
  47. */
  48.   If "" = SubStr(FULLNAME,1+IVOL+IDIRS+IBASE) | Upper(Right(FULLNAME,3)) ~= "LTX" Then Do
  49.     Okay1 "Fehler, die Datei muß eine Endung `.tex' oder `.ltx' haben."
  50.     Exit 5
  51.   End
  52. End
  53.  
  54. /*
  55. ** Name of the log file, which is hopefully created.
  56. */
  57. LOGNAME = Left(FULLNAME,IVOL+IDIRS+IBASE)".log"
  58.  
  59. /*
  60. ** Go to the LOG-File. This part is massively changed:
  61. ** Originally the 'next error' was the next relative to the current line in
  62. ** the `.tex' file. Now it is the next entry in the `.log' file. By jumping
  63. ** from one error to the next you go down through all errors. By closing
  64. ** the CED view of the `.log' file you can start anew.
  65. */
  66. 'Jump to File' "'"LOGNAME"'"
  67. If 0 = RESULT Then Do
  68.   Open New
  69.   Open '"'LOGNAME'"'
  70.   Editable File
  71.   DUMMY = SetClip("CURRENTLOGLINE","1")
  72. End
  73.  
  74. CURRENTTEXLINE = 0
  75. CURRENTLOGLINE = GetClip("CURRENTLOGLINE")
  76. 'Jump to line' CURRENTLOGLINE
  77.  
  78. /*
  79.  * Kein `^M' mehr.  RESULT wird erst von `Status CursorColumn' gesetzt!
  80.  */
  81. Do Until 1 = COLUMN
  82.   'Search for' "l."
  83.   FOUND = RESULT
  84.   If FOUND Then Do
  85.     Right
  86.     Status CursorColumn
  87.     COLUMN = RESULT
  88.   End
  89.   Else COLUMN = 1
  90. End
  91.  
  92. If FOUND Then Do
  93. /*
  94. ** Take the current line from CED
  95. */
  96.   'Status 55'
  97.   Parse Var RESULT "l." CURRENTTEXLINE .
  98. /*
  99. ** Save the current line plus 1 of the log file
  100. */
  101.   Status 57
  102.   DUMMY = SetClip("CURRENTLOGLINE",RESULT+2)
  103. End
  104.  
  105. /*
  106. ** Go back to the TeX-File
  107. */
  108. 'Jump to File' "'"FULLNAME"'"
  109. If 0 ~= CURRENTTEXLINE Then Do
  110.   'Jump to line' CURRENTTEXLINE
  111.   'Beg of line'
  112. End; Else Do
  113.   'Jump to File' "'"LOGNAME"'"
  114.   'End of file'
  115.   Okay1 "No more errors."
  116. End
  117.